import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: () => import("../views/Home"),
    redirect: "/recommend",
    children: [
      {
        path: "recommend",
        component: () => import("../views/Recommend"),
        children: [
          {
            path: ":id",
            component: () => import("@/components/common/songs-detail.vue"),
          },
        ],
      },
      {
        path: "singers",
        component: () => import("../views/Singers"),
        children:[
          {
            path:":id",
            component:()=>import('@/components/singers/singer')
          }
        ]
      },
      {
        path: "rank",
        component: () => import("../views/Rank"),
        children: [
          {
            path: ":id",
            component: () => import("@/components/common/songs-detail.vue"),
          },
        ],
      },
      {
        path:'movie',
        component:()=>import('../components/movie/Movie.vue')
      }
    ],
  }
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
